<?php
namespace Product\Model;

use Zend\InputFilter\Factory as InputFactory;     // <-- Add this import
use Zend\InputFilter\InputFilter;                 // <-- Add this import
use Zend\InputFilter\InputFilterAwareInterface;   // <-- Add this import
use Zend\InputFilter\InputFilterInterface;        // <-- Add this import

class Detail //implements InputFilterAwareInterface
{
    public $id;
    public $catalog_item;
	public $name;
    public $quantity;
	public $account;
    public $firstname;
    public $lastname;
    public $opportunity;
    public $categories;
    public $type;
    public $pricefrequency;
    public $code;
    public $value;
    public $stage;

    public function exchangeArray($data)
    {
        $this->id     = (isset($data['id'])) ? $data['id'] : null;
        $this->catalog_item     = (isset($data['catalog_item'])) ? $data['catalog_item'] : null;
        $this->name = (isset($data['name'])) ? $data['name'] : null;
		$this->quantity  = (isset($data['quantity'])) ? $data['quantity'] : null;
		$this->account  = (isset($data['account'])) ? $data['account'] : null;
		$this->firstname  = (isset($data['firstname'])) ? $data['firstname'] : null;
		$this->lasttname  = (isset($data['lastname'])) ? $data['lastname'] : null;
		$this->opportunity = (isset($data['opportunity'])) ? $data['opportunity'] : null;
		$this->categories = (isset($data['categories'])) ? $data['categories'] : null;
		$this->type  = (isset($data['type'])) ? $data['type'] : null;
		$this->pricefrequency  = (isset($data['pricefrequency'])) ? $data['pricefrequency'] : null;
		$this->code  = (isset($data['code'])) ? $data['code'] : null;
		$this->value  = (isset($data['value'])) ? $data['value'] : null;
		$this->stage = (isset($data['stage'])) ? $data['stage'] : null;
    }
	
	public function __construct(array $options = null) {
        if (is_array($options)) {
            $this->setOptions($options);
        }
    }
        
    public function getArrayCopy()
     {
         return get_object_vars($this);
     }
	
	protected $inputFilter; 
    
    public function setInputFilter(InputFilterInterface $inputFilter) 
    { 
        throw new \Exception("Not used"); 
    } 
    
    public function getInputFilter() 
    { 
        if (!$this->inputFilter) 
        { 
            $inputFilter = new InputFilter(); 
            $factory = new InputFactory(); 
            
        
        $inputFilter->add($factory->createInput(array(
            'name' => 'name', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
           
        ))); 
 
        $inputFilter->add($factory->createInput(array(
            'name' => 'description', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
            
        ))); 
                
                $inputFilter->add($factory->createInput(array(
            'name' => 'quantity', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
            
        ))); 
 
                $inputFilter->add($factory->createInput(array(
            'name' => 'type', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
            
        ))); 
                
                $inputFilter->add($factory->createInput(array(
            'name' => 'pricefrequency', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
            
        ))); 
        
                $inputFilter->add($factory->createInput(array(
            'name' => 'ownedsecurableitem_id', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
            
        ))); 

                $inputFilter->add($factory->createInput(array(
            'name' => 'account_id', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
            
        )));
                
                $inputFilter->add($factory->createInput(array(
            'name' => 'contact_id', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
            
        ))); 
                
                $inputFilter->add($factory->createInput(array(
            'name' => 'opportunity_id', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
             
        ))); 
                
                $inputFilter->add($factory->createInput(array(
            'name' => 'producttemplate_id', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
            
        ))); 
                
                $inputFilter->add($factory->createInput(array(
            'name' => 'stage_customfield_id', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
             
        ))); 
                
                $inputFilter->add($factory->createInput(array(
            'name' => 'sellprice_currencyvalue_id', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
            
        ))); 
        $this->inputFilter = $inputFilter;
        }

        return $this->inputFilter;
    }
}